package com.allwees.support.marketing.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.allwees.support.marketing.constant.AdjustPriceRuleCode;
import lombok.Data;

import java.util.Date;

/**
 * @Author Daniel
 * @Version 1.0.0
 * @Description
 * @CreateTime 2020/8/31 16:24
 */
@Data
@TableName("adjust_price_rule")
public class AdjustPriceRule {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String ruleName;

    private AdjustPriceRuleCode ruleCode;

    private String ruleContent;

    /**
     * 0-启用 1-禁用
     */
    private Integer status;

    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;

    @JsonIgnore
    public boolean isValid(){
        return this.status == 0;
    }
}